<?php

/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\model;

use think\Model;

class KsAdvertiserDailyStatModel extends Model
{
    public const SYNC_DISABLE = 0;
    protected $name = 'ks_advertiser_daily_stat';

    /*
     * 获取消耗
    */
    public function getCost(): float
    {
        return floatval($this->daily_charge + $this->order_total_charged);
    }
    /*
     * 获取赠款消耗
     */
    public function getRewardCost(): float
    {
        return floatval(bcadd(strval($this->contract_rebate_real_charged), strval($this->direct_rebate_real_charged), 3));
    }


    /*
    * 获取现金消耗
    */
    public function getCashCost(): float
    {
        return floatval($this->real_charged + $this->order_real_charged);
    }

    /*
    * 获取余额
    */
    public function getBalance(): float
    {
        return floatval($this->balance);
    }
}
